/**
 * “前台管理”相关接口
 */
import request from '@/utils/request'

export default {
  //category.vue start
  getCategory(params){
    const data ={
      showInNav: params.showInNav,
      display: params.display
    };
    return request({
      url: 'shopCategory/infos',
      method: 'post',
      data
    })
  },
  saveCategory(categoryInfo,attributeInfo){
    const data = {
      categoryInfo: categoryInfo,
      attributeInfo: attributeInfo
    };
    return request({
      url: 'shopCategory/save',
      method: 'post',
      data
    })
  },
  updateCategory(categoryInfo,attributeInfo){
    const data = {
      categoryInfo: categoryInfo,
      attributeInfo: attributeInfo
    };
    return request({
      url: 'shopCategory/update',
      method: 'post',
      data
    })
  },
  deleteCategory(params){
    const data = params;
    return request({
      url: 'shopCategory/delete',
      method: 'post',
      data
    })
  },
  getAttributeInfos(params){
    const data = params;
    return request({
      url: 'shopAttribute/data/list',
      method: 'post',
      data
    })
  },
  //category.vue end
}
